#pragma once

class AgentSession
{
public:
	AgentSession(void);
	~AgentSession(void);

	void Set(const char * ip, WORD port);
	void Set(DWORD ip, WORD port);
	void Set(const SOCKADDR_IN &addr);

	DWORD GetIP() const;
	const char *GetStrIP() const;
	WORD GetPort() const;

	const char * GetHostName() const;
	void SetHostName(const char *hostname);

	time_t GetTimestamp() const { return mTimestamp; }
	void SetTimestamp(time_t t) { mTimestamp = t; }

	DWORD GetDeviceConfig() const { return mDeviceConfig; }
	void SetDeviceConfig(DWORD dc) { mDeviceConfig = dc; }

	const SOCKADDR_IN & GetAddr() const;

	bool operator == (const AgentSession &ref);

private:
	SOCKADDR_IN mAddr;
	char mHostName[MAX_HOSTNAME_LEN];
	time_t mTimestamp;
	DWORD mDeviceConfig;
};
